Optimal. Leaf size=75 \[ a^3 x+\frac {b \left (2 a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a b^2 \tan (c+d x)}{2 d}-\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.06, antiderivative size = 75, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 5, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {4127, 4003,
3855, 3852, 8} \begin {gather*} a^3 x+\frac {b \left (2 a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a b^2 \tan (c+d x)}{2 d}-\frac {b^2 \tan (c+d x) (a+b \sec (c+d x))}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 3852
Rule 3855
Rule 4003
Rule 4127
Rubi steps
\begin {align*} \int (a+b \sec (c+d x)) \left (a^2-b^2 \sec ^2(c+d x)\right ) \, dx &=-\int (-a+b \sec (c+d x)) (a+b \sec (c+d x))^2 \, dx\\ &=-\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}-\frac {1}{2} \int \left (-2 a^3-b \left (2 a^2-b^2\right ) \sec (c+d x)+a b^2 \sec ^2(c+d x)\right ) \, dx\\ &=a^3 x-\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}-\frac {1}{2} \left (a b^2\right ) \int \sec ^2(c+d x) \, dx+\frac {1}{2} \left (b \left (2 a^2-b^2\right )\right ) \int \sec (c+d x) \, dx\\ &=a^3 x+\frac {b \left (2 a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}+\frac {\left (a b^2\right ) \text {Subst}(\int 1 \, dx,x,-\tan (c+d x))}{2 d}\\ &=a^3 x+\frac {b \left (2 a^2-b^2\right ) \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a b^2 \tan (c+d x)}{2 d}-\frac {b^2 (a+b \sec (c+d x)) \tan (c+d x)}{2 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.03, size = 75, normalized size = 1.00 \begin {gather*} a^3 x+\frac {a^2 b \tanh ^{-1}(\sin (c+d x))}{d}-\frac {b^3 \tanh ^{-1}(\sin (c+d x))}{2 d}-\frac {a b^2 \tan (c+d x)}{d}-\frac {b^3 \sec (c+d x) \tan (c+d x)}{2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.06, size = 82, normalized size = 1.09
method | result | size |
derivativedivides | \(\frac {a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} \left (d x +c \right )-b^{2} a \tan \left (d x +c \right )}{d}\) | \(82\) |
default | \(\frac {a^{2} b \ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )-b^{3} \left (\frac {\sec \left (d x +c \right ) \tan \left (d x +c \right )}{2}+\frac {\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )}{2}\right )+a^{3} \left (d x +c \right )-b^{2} a \tan \left (d x +c \right )}{d}\) | \(82\) |
risch | \(a^{3} x +\frac {i b^{2} \left ({\mathrm e}^{3 i \left (d x +c \right )} b -2 a \,{\mathrm e}^{2 i \left (d x +c \right )}-b \,{\mathrm e}^{i \left (d x +c \right )}-2 a \right )}{d \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{2}}+\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right ) a^{2}}{d}-\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{2 d}-\frac {b \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right ) a^{2}}{d}+\frac {b^{3} \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{2 d}\) | \(153\) |
norman | \(\frac {a^{3} x +a^{3} x \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )+\frac {b^{2} \left (2 a -b \right ) \left (\tan ^{3}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}-2 a^{3} x \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )-\frac {b^{2} \left (2 a +b \right ) \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}{d}}{\left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )^{2}}-\frac {b \left (2 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{2 d}+\frac {b \left (2 a^{2}-b^{2}\right ) \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{2 d}\) | \(162\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 93, normalized size = 1.24 \begin {gather*} \frac {4 \, {\left (d x + c\right )} a^{3} + b^{3} {\left (\frac {2 \, \sin \left (d x + c\right )}{\sin \left (d x + c\right )^{2} - 1} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + 4 \, a^{2} b \log \left (\sec \left (d x + c\right ) + \tan \left (d x + c\right )\right ) - 4 \, a b^{2} \tan \left (d x + c\right )}{4 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.22, size = 116, normalized size = 1.55 \begin {gather*} \frac {4 \, a^{3} d x \cos \left (d x + c\right )^{2} + {\left (2 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (\sin \left (d x + c\right ) + 1\right ) - {\left (2 \, a^{2} b - b^{3}\right )} \cos \left (d x + c\right )^{2} \log \left (-\sin \left (d x + c\right ) + 1\right ) - 2 \, {\left (2 \, a b^{2} \cos \left (d x + c\right ) + b^{3}\right )} \sin \left (d x + c\right )}{4 \, d \cos \left (d x + c\right )^{2}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a - b \sec {\left (c + d x \right )}\right ) \left (a + b \sec {\left (c + d x \right )}\right )^{2}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.59, size = 137, normalized size = 1.83 \begin {gather*} \frac {2\,a^3\,\mathrm {atan}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {b^3\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {b^3\,\sin \left (c+d\,x\right )}{2\,d\,{\cos \left (c+d\,x\right )}^2}+\frac {2\,a^2\,b\,\mathrm {atanh}\left (\frac {\sin \left (\frac {c}{2}+\frac {d\,x}{2}\right )}{\cos \left (\frac {c}{2}+\frac {d\,x}{2}\right )}\right )}{d}-\frac {a\,b^2\,\sin \left (c+d\,x\right )}{d\,\cos \left (c+d\,x\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________